#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void Copy_file()
{
	FILE* pr = fopen("data.txt", "r");
	if (pr == NULL)
	{
		perror("fopen read err");
		exit(1);
	}
	FILE* pt = fopen("data_copy.txt", "w");
	if (pt == NULL)
	{
		perror("fopen write err");
		return 1;         
	}
	char ch = 0;
	while ((ch = fgetc(pr)) != EOF)
	{
		fputc(ch,pt);
	}
	fclose(pr);
	fclose(pt);
	pr = NULL;
	pt = NULL;
}
int main()
{
	Copy_file();
	return 0;
}